package com.company.oa.workflow.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.company.oa.workflow.dto.leave.LeaveDTO;
import com.company.oa.workflow.entity.leave.Leave;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

public interface LeaveService extends IService<Leave> {
    
    /**
     * 分页查询请假列表
     */
    IPage<Leave> getPage(int page, int size, Leave leave);
    
    /**
     * 创建请假申请（草稿）
     */
    boolean createLeave(LeaveDTO leaveDTO, Long userId);
    
    /**
     * 更新请假申请
     */
    boolean updateLeave(LeaveDTO leaveDTO);
    
    /**
     * 提交请假申请
     */
    boolean submitLeave(Long id);
    
    /**
     * 取消请假申请
     */
    boolean cancelLeave(Long id);
    
    /**
     * 上传附件
     */
    String uploadAttachment(MultipartFile file);
    
    /**
     * 获取请假详情
     */
    Map<String, Object> getLeaveDetail(Long id);
    
    /**
     * 获取我的请假列表
     */
    IPage<Leave> getMyLeaves(int page, int size, Long userId, Integer status);
} 